<?php
/**
 * 勋章接口
 * 输出勋章
 * 验证用户身份token
 * @author Edwin
 */
namespace V1\Controller;

use Common\Controller\ApiController;

class MedalController extends ApiController
{
    public function rest()
    {
        switch ($this->_method) {
            case 'get': // get请求处理代码
                $this->_get();
                break;
        }
    }

    /**
     * 输出勋章
     */
    private function _get()
    {
        if (I('id')) {
            $data = D('ExpertProfile')->return_rank(I('id'));
            if(!$data){
                $this->myApiPrint(C('STATUS')['230'],201,[]);
            }else{
                $this->myApiPrint(C('STATUS')['200'],200,$data);
            }
        }
    }
}